package com.hlhj.funlike_business.activity.adapter;

import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.hlhj.funlike_business.R;
import com.hlhj.funlike_business.bean.OrderDetailBean;
import com.hlhj.funlike_business.utils.DelTextView;

import java.util.List;

public class DetailOrderItemAdp extends BaseQuickAdapter<OrderDetailBean.DataBean.GoodsBean,BaseViewHolder>{
    public DetailOrderItemAdp(@Nullable List<OrderDetailBean.DataBean.GoodsBean> data) {
        super(R.layout.adp_detailorderitem,data);
    }

    @Override
    protected void convert(BaseViewHolder helper, OrderDetailBean.DataBean.GoodsBean item) {
        ImageView imgView = helper.getView(R.id.img_order);
        TextView tv_orderItemName = helper.getView(R.id.tv_orderItemName);
        TextView tv_foodnum = helper.getView(R.id.tv_foodnum);
        TextView tv_price = helper.getView(R.id.tv_price);
        DelTextView deltv_price = helper.getView(R.id.deltv_price);

        Glide.with(mContext).load(item.getImg()).into(imgView);
        tv_orderItemName.setText(item.getGoods_name());
        tv_foodnum.setText("X" + item.getNum());
        deltv_price.setText("￥" + item.getPrice());
        tv_price.setText("￥" + item.getDiscount_price());
    }
}
